Enumerate morphisms and subgraph isomorphisms#22
Open
mstn wants to merge 17 commits intohellas-ai:masterfrom
Open
Enumerate morphisms and subgraph isomorphisms#22mstn wants to merge 17 commits intohellas-ai:masterfrom
mstn wants to merge 17 commits intohellas-ai:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Before applying rewrites, we need a way to find matches. We are both interested in subgraph isomorphisms and generic morphisms. For example, in the Rewrite Theory papers, a match is not restricted to only embeds.
Details
Morphismcan be created only viafind_homomorphismsandfind_isomorphismsmethods that guarantee that it is actually a morphism. We can use it as input for rewrite function in here Rewriting for Lax Hypergraphs #20 where we may relax assertions on the candidate match.0/7 != 7/0.Discussion
Note: here we talk about the match
Pattern -> Host, not the left ruleInterface -> Pattern.In this implementation, a match is a generic morphism. As an option we can enforce mono on both nodes and edges. In many practical contexts, it makes sense to restrict to mono since we are interested in embeddings (e.g. matches on AST or IR). However, non-mono matches might be closer to Frobenius philosophy. For example, target
f(a,a)whereais the same wire connected to two ports and rule isf(x,x)with two distinct wires with the same label.In the literature, sometimes, mono matches are mono on nodes only. For graphs, it doesn't matter, but the difference is important for hypergraphs. However, in some cases, pattern hyperedges are identified solely by their node sets and label, so if two pattern hyperedges have the same nodes, they are considered the same hyperedge rather than distinct ones, thus mono on nodes automatically implies mono on hyperedges. If we are in this situation, we might think of relaxing the definition of match.
What definitions of "match" are used in other tools and literature? Warning: ChatGPT generated.